import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

export const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    meta: {
      title: '首页',
      menuTitle: '首页',
    },
  },
  {
    path: '/user/login',
    name: 'login',
    component: () => import('@/views/user/UserLogin.vue'),
    meta: {
      title: '用户登录',
      menuTitle: '用户登录',
    },
  },
  {
    path: '/user/register',
    name: 'register',
    component: () => import('@/views/user/UserRegister.vue'),
    meta: {
      title: '用户注册',
      menuTitle: '用户注册',
    },
  },
  {
    path: '/admin/userManage',
    name: 'userManage',
    component: () => import('@/views/admin/UserManage.vue'),
    meta: {
      title: '用户管理',
      menuTitle: '用户管理',
    },
  },
  {
    path: '/app/chat/:id',
    name: 'chat',
    component: () => import('@/views/app/AppChatView.vue'),
    meta: {
      title: '应用聊天',
      menuTitle: '应用聊天',
    },
  },
  {
    path: '/admin/appManage',
    name: 'appManage',
    component: () => import('@/views/admin/AppManage.vue'),
    meta: {
      title: '应用管理',
      menuTitle: '应用管理',
    },
  },
  {
    path: '/admin/chatManage',
    name: 'chatManage',
    component: () => import('@/views/admin/ChatManage.vue'),
    meta: {
      title: '对话管理',
      menuTitle: '对话管理',
    },
  },
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes,
})

export default router
